<?php
	$Class = $_REQUEST['Class'];
	$id = $_REQUEST['id'];
	
	if(!empty($id))
	{
		$Res = $mysql -> prepare('SELECT * FROM `'.RC_DBTABLEPRE.'students` WHERE id=? ORDER BY `id` ASC');
		$Res -> execute(array($id));
	}
	else
	{
		$Res = $mysql -> prepare('SELECT * FROM `'.RC_DBTABLEPRE.'students` WHERE class=? ORDER BY `id` ASC');
		$Res -> execute(array($Class));
	}
	$ClassList = $Res -> fetchAll();
	$Res -> closecursor();
	echo serialize($ClassList);
?>